package com.cai310.lottery.ticket.protocol.local.disassemble;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cai310.lottery.support.welfare3d.Welfare3dPlayType;
import com.cai310.lottery.ticket.dto.PrintInterfaceDTO;
import com.cai310.lottery.ticket.dto.TicketDTO;
import com.cai310.lottery.ticket.protocol.local.dataconver.W3DDataConverHongbo;

public class Welfare3DDisassemble extends AbstractDisassemble {
	
	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	protected int getMaxMultiple() {
		return 99;
	}

	@Override
	protected int getMaxUnitsKeno() {
		return 5;
	}

	@Override
	protected int getMaxUnitsCommon() {
		return 5;
	}

	@Override
	protected List<TicketDTO> doCompound(PrintInterfaceDTO printData, Date createTime)
			throws Exception {
		if (printData.getBetType() == Welfare3dPlayType.GroupSum.ordinal()// 福彩3D组选和值需要分解为组选3与组选6
				|| printData.getBetType() == Welfare3dPlayType.Group3Kuadu.ordinal()// 福彩3D组三跨度需要分解为单式组选3
				|| printData.getBetType() == Welfare3dPlayType.Group6Kuadu.ordinal()// 福彩3D组六跨度需要分解为单式组选6
				|| printData.getBetType() == Welfare3dPlayType.DirectKuadu.ordinal()) {// 福彩3D直选跨度转为直选单式

			List<TicketDTO> resultList = new ArrayList<TicketDTO>();
			List<TicketDTO> ticketList = W3DDataConverHongbo.converData(printData, createTime);
			for (TicketDTO ticket : ticketList) {
				resultList.addAll(this.doMultiple(ticket));
			}
			return resultList;
		} else {
			return super.doCompoundCommon(printData, createTime);
		}
	}
	
	

	
}
